package jp.sourceforge.akjrcp.psp;

import jp.sourceforge.akjrcp.akj_betas.Akj_betasPlugin;
import jp.sourceforge.akjrcp.akj_betas.Messages;
import jp.sourceforge.akjrcp.dropsomething2.FFMpegDropSomethingTab2;
import jp.sourceforge.akjrcp.dropsomething2.psp.PSPConvertTabBuilder2;
import jp.sourceforge.akjrcp.dropsomething2.psp.PSPOptionEditor;
import jp.sourceforge.akjrcp.ui.GenericParameters;
import jp.sourceforge.akjrcp.ui.GenericParametersEditorDialog;
import jp.sourceforge.akjrcp.ui.GenericParametersFieldEditor;

import org.eclipse.jface.preference.BooleanFieldEditor;
import org.eclipse.jface.preference.FieldEditorPreferencePage;
import org.eclipse.jface.preference.StringFieldEditor;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;

public class PSPSettingPage extends FieldEditorPreferencePage
implements IWorkbenchPreferencePage {
	public static final String EXPORT_MOVIE_SETTINGS="pspconvert2"+"."+FFMpegDropSomethingTab2.SETTINGS;
	public static final String EXPORT_MOVIE_SETTINGS_INDEX="pspsetting2"+"."+FFMpegDropSomethingTab2.SELECTION_INDEX;
	public static final String HQ_SETTINGS="pspsetting.hqsetting";
	public static final String DROP_FILTER_VIDEO="pspsetting.drop_filter_video";

	public static final String MAKE_THUMBNAIL="pspsetting.makethumbnail";
	public PSPSettingPage() {
		super(GRID);
		setPreferenceStore(Akj_betasPlugin.getDefault().getPreferenceStore());
		setDescription(Messages.getString("pspsetting.description")); //$NON-NLS-1$
		initializeDefaults();
	}
	
	private void initializeDefaults() {
		
		// no one call it before open them

	}

	protected void createFieldEditors() {
		GenericParametersFieldEditor parametersEditor=new GenericParametersFieldEditor(EXPORT_MOVIE_SETTINGS,Messages.getString("pspconvert.pspconvert_settings"),getFieldEditorParent()){	
			protected GenericParameters createNewGenericParameters(
					GenericParametersEditorDialog dialog) {
				return PSPConvertTabBuilder2.newGenericParameters();
			}
		};
		
		parametersEditor.setOptionEditorClass(PSPOptionEditor.class);// i don know this is smart or not
		parametersEditor.setDialogWidth(720);
		parametersEditor.setDialogHeight(640);
		addField(parametersEditor);
		adjustGridLayout();
		addField(new PSPHQFieldEditor(HQ_SETTINGS,Messages.getString("pspsetting.hq_settings"),60,getFieldEditorParent()));
		addField(new StringFieldEditor(DROP_FILTER_VIDEO,Messages.getString(DROP_FILTER_VIDEO),getFieldEditorParent()));
		addField(new BooleanFieldEditor(MAKE_THUMBNAIL,Messages.getString(MAKE_THUMBNAIL),getFieldEditorParent()));
        
	}

	public void init(IWorkbench workbench) {
		
	}

}
